<?php
namespace Zxf5115\Laravel\Advertising\Models\Api\Advertising;

use Illuminate\Database\Eloquent\Relations\HasMany;
use Zxf5115\Laravel\Advertising\Models\Common\Advertising\Position as Common;

/**
 * @author zhangxiaofei [<1326336909@qq.com>]
 * @dateTime 2025-09-23
 *
 * 广告位模型类
 */
class Position extends Common
{
  /**
   * 需要隐藏的字段
   */
  public $hidden = [
    'organization_id',
    'title',
    'width',
    'height',
    'sort',
    'status',
    'create_time',
    'update_time'
  ];


  // 关联函数 ------------------------------------------------------

  /**
   * 广告位与广告的关联
   *
   * @return [关联对象]
   */
  public function advertising() : HasMany
  {
    return $this->hasMany(
      'Zxf5115\Laravel\Advertising\Models\Api\Advertising',
      'position_id',
      'id'
    );
  }
}
